<!DOCTYPE >
<html lang="en" class="x-admin-sm" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8"/>
    <title>一站式众包服务平台</title>
    <meta name="description" content="一站式众包服务平台"/>
    <meta name="keywords" content="一站式众包服务平台"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"/>
    <header th:replace="header::html"></header>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/index.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/xadmin/lib/layui/css/layui.css}" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" th:href="@{/bootstrapguo/css/style.css}">
    <script th:src="@{/js/jquery.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/index.min.js}" type="text/javascript"></script>
    <script th:src="@{/xadmin/lib/layui/layui.js}" type="text/javascript"></script>

</head>


<body class="loading">

<header>
    <!--                未登录的时候-->
    <span th:if="${ #authentication?.principal}==null">
        <a class="" href="/api-front/getPage?pageName=frontPage/user-login#" style="color: #0e90d2">我要登录</a>
        <a class="layui-elip" onclick="xadmin.open('注册','/user/add')" permission="sys:user:add"
           style="color: #0e90d2">我要注册</a>
    </span>


    <!--        登陆-->
    <span th:if="${ #authentication?.principal} !=null">
            <span th:if="${#authentication.principal.rid}!=5">
                 <a sec:authentication="principal.uname" style="color: #0e90d2"
                    href="/api-front/getPage?pageName=frontPage/personal#" class=""></a>
            </span>

            <span th:if="${#authentication.principal.rid}==5">
                 <a sec:authentication="principal.uname" style="color: #0e90d2"
                    href="/api-front/getPage?pageName=frontPage/arbitration#" class=""></a>
                【仲裁员】
            </span>

                <span th:if="${#authentication.principal.rid}==2">
                     【服务商】
                <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/tender#"
                   style="color: #0e90d2">
                    我要投标
                </a>
                    <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/alliance#"
                       style="color: #0e90d2">
                    我要联盟
                </a>
                    <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/myAlliance#"
                       style="color: #0e90d2">
                    我的联盟
                </a>
                    <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/myWorks#"
                       style="color: #0e90d2">
                    发布作品
                </a>
                     <a class="layui-elip" href="/api-front/chat/user-chat#" style="color: #0e90d2">
                    进入聊天室
                   </a>
                         <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/mynews#"
                            style="color: #0e90d2">
                           <span id="myNews" class="abc">我的消息</span>
                          </a>

                </span>

            <span th:if="${#authentication.principal.rid}==7">
                     【服务商】
                <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/tender#"
                   style="color: #0e90d2">
                    我要投标
                </a>
                <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/alliance#"
                   style="color: #0e90d2">
                    我要联盟
                </a>
               <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/myAlliance#"
                  style="color: #0e90d2">我的联盟</a>
                    <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/myWorks#"
                       style="color: #0e90d2">发布作品</a>
                     <a class="layui-elip" href="/api-front/chat/user-chat#"
                        style="color: #0e90d2">进入聊天室</a>
                         <a class="layui-elip " href="/api-front/getPage?pageName=frontPage/mynews#"
                            style="color: #0e90d2">
                           <span id="myNews2" class="abc">我的消息</span>
                          </a>
                </span>


                <span th:if="${#authentication.principal.rid}==3">
                   【雇主】
                    <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/release#"
                       style="color: #0e90d2">
                    进入交易社区
                </a>
                      <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/purchase#"
                         style="color: #0e90d2">
                    购买作品
                </a>
                    <a class="layui-elip" href="/api-front/chat/service-list#" style="color: #0e90d2">
                    找服务商
                </a>

                </span>

            <span th:if="${#authentication.principal.rid}!=5">
                 <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/personal#"
                    style="color: #0e90d2">
                    个人中心
                </a>
            </span>
            <span th:if="${#authentication.principal.rid}==5">
                 <a class="layui-elip" href="/api-front/getPage?pageName=frontPage/arbitration#"
                    style="color: #0e90d2">
                    个人中心
                </a>
            </span>
            <a href="/frontLogout" style="color: #0e90d2" class="layui-elip">退出</a></dd>

        </span>


    <nav class="menu">
        <ul class="list-inline">
            <li class="active" style="font-size: 15px"><a href="#">首页</a></li>
            <li style="font-size: 15px"><a>业务</a></li>
            <li style="font-size: 15px"><a>成功案例</a></li>
            <li style="font-size: 15px"><a>信用查询</a></li>
            <li style="font-size: 15px"><a>顾问展示</a></li>
            <li style="font-size: 15px"><a>行业动态</a></li>
            <li style="font-size: 15px"><a>雇主故事</a></li>
            <li style="font-size: 15px"><a>曝光台</a></li>
            <li style="font-size: 15px"><a>规则中心</a></li>
            <li style="font-size: 15px"><a>最新资讯</a></li>
            <li style="font-size: 15px"><a>友情链接</a></li>
        </ul>
    </nav>
</header>


<div class="welcome"><p><u>Loading . . .</u></p></div>


<section class="video">
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide nth1">
                <div class="box">
                    <div class="left"></div>
                    <div class="right">
                        <span>种服务,致力于客户需求</span><i></i>
                        <p>始于 2020 展望未来<br/>专注于用户服务体验，专业于解决用户需求</p>
                    </div>
                </div>
            </div>
            <div class="swiper-slide nth2">
                <div class="box">
                    <span>服务简单快捷</span><i></i>
                    <p>不是非要高大上，只是醉心于服务<br/>我们想，再上一个好案例</p>
                </div>
            </div>
            <div class="swiper-slide nth3">
                <div class="box">
                    <div class="top">服务派，论持久</div>
                    <div class="mid"></div>
                    <div class="bottom">我说，业界没有最好的服务，只有最棒的贴心关键<br/>个性化需求，为客户和您的团队</div>
                </div>
            </div>
            <div class="swiper-slide nth4">
                <div class="box">
                    <div class="top"><span>服务到位，展望未来</span><i></i></div>
                    <div class="bottom">全新体验<u>雇主</u>与<u>服务商</u><br/>抢占头等商机<br/>基于<u>众包</u>服务大众，高于一切</div>
                </div>
            </div>
        </div>
    </div>
    <div class="innerBox">
        <div class="news">
            <span>NEWS :</span>
            <a href="/404.html" class="more" target="_blank">more</a>
            <ul>

                <li><a href="/404.html" target="_blank" title="钱都交了，为什么发布的需求没有效果？">钱都交了，为什么发布的需求没有效果？ ...</a>
                </li>

                <li><a href="/404.html" target="_blank" title="服务到位，价格有一点偏差，但是效果很好">服务到位，价格有一点偏差，但是效果很好
                    ...</a></li>

                <li><a href="/404.html" target="_blank" title="留白设计是一种高端艺术，要懂得在网页设计中运用负空间">留白设计是一种高端艺术，要懂得在网页
                    ...</a></li>

                <li><a href="/404.html" target="_blank" title="良心服务商推荐：吴一帆良心服务">良心服务商推荐：吴一帆良心服务 ...</a>
                </li>

                <li><a href="/404.html" target="_blank" title="为你的 需求 选择最好的服务">为你的 需求 选择最好的服务</a></li>

            </ul>
        </div>
        <div class="guide"></div>
        <a class="movedown"></a>
    </div>
</section>

<section class="business">
    <div class="box">
        <div class="caption">
            <i></i><span>我们能做什么</span>
            <br class="clear"/>
        </div>
        <ul class="items list-inline">
            <li class="pc">
                <i></i><strong>高端定制服务需求</strong>
                <p>企业高端定制网站设计<br/>彰显品牌形象</p>
            </li>
            <li class="mobi">
                <i></i><strong>影视制作</strong>
                <p>定制影视 / 微电影制作<br/>充满视觉冲击力</p>
            </li>
            <li class="sys">
                <i></i><strong>作品展示</strong>
                <p>优秀作品展示<br/>能购买也能定制</p>
            </li>
            <li class="app">
                <i></i><strong>APP应用程序</strong>
                <p>基于 iOS / Android 应用开发<br/>掌控智能终端时代</p>
            </li>
            <li class="host">
                <i></i><strong>生活家政</strong>
                <p>我们不只提供云硬件和网络<br/>更加注重生活</p>
            </li>
        </ul>
    </div>
</section>

<section class="cases">
    <div class="box">
        <div class="caption" style="margin-top: -200px">
            <i></i><span>案例欣赏</span>
            <br class="clear"/>
        </div>
        <div class="swiper-container items">
            <div class="swiper-wrapper">
                <div id="succCase">
                </div>
            </div>
        </div>
        <a href="/successCaseFront/JumpCase" title="欣赏更多成功案例" class="more" target="_blank">更多</a>
    </div>
</section>


<section class="quality">
    <div class="box">
        <div class="caption">
            <i></i><span>平台用户信用分查询</span>
            <br class="clear"/>
        </div>
        <div class="swiper-container items">
            <div class="swiper-wrapper">
                <div class="layui-inline layui-show-block" style="width:50%;margin-left: 25%">
                    <input type="text" style="width: 100%;height: 6%;font-size: 18px" name="creditAccount"
                           id="creditAccount" placeholder="请输入服务商或者雇主账号ID" autocomplete="off" class="layui-input">
                </div>
                <button class="layui-btn" type="button" style="height: 6%" id="searchCredit"><i class="layui-icon">&#xe615;</i>
                </button>
            </div>
        </div>

        <span th:if="${ #authentication?.principal} !=null">
            <span th:if="${#authentication.principal.rid}!=5">
            <a class="lookall" target="_blank"
               onclick="xadmin.open('我的信用守约明细','/api-front/credit/myCredit')">查看我的信用守护记录</a>
            </span>
        </span>
    </div>
</section>

<section class="marketing">

    <div class="box" id="fuck" style="padding-top: 10%">
        <div class="caption">
            <i></i><span>顾问展示</span>
            <br class="clear"/>
        </div>
    </div>
    <table style="margin:auto;padding-top: 1%">
        <tr id="tr1"></tr>
        <tr id="tr2"></tr>
    </table>
</section>

<section class="aboutus">
    <ul class="menu">
        <li>数码通讯</li>
        <li>生活服务</li>
        <li>智能硬件</li>
        <li>软件科学</li>
    </ul>
    <div class="swiper-container items" style="width: 1100px;height: 600px;padding-top: 300px">
        <div class="swiper-wrapper">
            <div class="swiper-slide nth1">
                <strong>数码通讯行业资讯</strong>
                <br>
                <div id="industryShu">
                </div>
            </div>
            <div class="swiper-slide nth1">
                <strong>生活服务行业资讯</strong>
                <br>
                <div id="industrySheng">
                </div>
            </div>
            <div class="swiper-slide nth1">
                <strong>智能硬件行业资讯</strong>
                <br>
                <div id="industryZhi">
                </div>
            </div>
            <div class="swiper-slide nth1">
                <strong>软件科学行业资讯</strong>
                <br>
                <div id="industryTest"></div>
            </div>
        </div>
    </div>
    <table class="exp">
        <tr>
            <td><u>5</u>位小朋友制作</td>
            <td><u>15</u>天时间</td>
            <td><u>100</u>次数据库结构变动</td>
            <td><u>200</u>次在线讨论</td>
            <td><u>300</u>次测试后上线</td>
        </tr>
    </table>
</section>

<section class="cases" style="background: url(../images/guzhu.jpg) no-repeat 0px center  ;background-size:100%">
    <div class="box" >
        <div class="caption" style="margin-top: -200px">
            <i></i><span>雇主故事</span>
            <br class="clear"/>
            <span>
                 <span th:if="${ #authentication?.principal}!=null">
                     <span th:if="${#authentication.principal.rid}==3">
                     <button class="layui-btn layui-btn-primary" type="button" id="writeStory">留下故事</button>
                     <button class="layui-btn layui-btn-primary layui-btn-sm" type="button"
                             onclick="xadmin.open('记录我的故事','/api-front/story/myStory')">我的故事</button>
                     </span>
                </span>
                 &nbsp;<button class="layui-btn layui-btn-primary" type="button" id="moreStory"
                               onclick="xadmin.open('更多雇主精彩故事','/story/moreStory')">更多精彩</button>
            </span>

        </div>
        <div style="width: 80%;margin: auto">
            <div class="layui-carousel" id="storyCarousel">
                <div carousel-item id="storydiv">
                </div>
            </div>
        </div>
    </div>
</section>


<section class="cases" style="background: url(../images/baoguang.jpg) no-repeat 0px center ;background-size:100%">
    <div class="box" >
        <div class="caption" style="margin-top: -200px">
            <i></i><b><span>曝光台</span></b>
            <br class="clear"/>
            <a style="color: #3082ff;margin-left: 45%;font-size: 18px" id="findExposure"
               onclick="xadmin.open('曝光台','/exposure/moreExposure')">查看更多>></a>
            <br>
        </div>
        <div id="exposure" style="width: 800px;height: 450px;margin: auto">
            <div class="layui-carousel" id="test10">
                <div carousel-item="" id="exposure_div">

                </div>
            </div>
        </div>

    </div>
</section>

<section class="cases" style="background: url(../images/guize.jpg) no-repeat 0px center ;background-size:100%">
    <div class="box" >
        <div class="caption" style="margin-top: -200px">
            <i></i><span>规则中心</span>
            <br class="clear"/>
        </div>
        <div class="layui-collapse" lay-accordion="" id="rule">
        </div>
    </div>
</section>

<section class="cases"  style="background: url(../images/zixun.jpg) no-repeat 0px center ;background-size:100%">
    <div class="box">
        <div class="caption" style="margin-top: -200px">
            <i></i><span>最新资讯</span>
            <br class="clear"/>
        </div>
        <div class="swiper-container items">
            <div class="swiper-wrapper">
                <div id="latestNews">
                </div>
            </div>
        </div>
    </div>
</section>

<section class="clients">
    <div class="box" id="friendShipLink">
        <div class="caption">
            <i></i><span>友情链接</span>
            <br class="clear"/>
        </div>
    </div>
</section>


<div class="dock">
    <ul class="icons">
        <li class="up"><i></i></li>
        <li class="im">
            <i></i>
            <p>网站咨询<br/>在线沟通，请点我<a href="/api-front/chat/user-chat#" target="_blank">在线咨询</a></p>
        </li>
        <li class="tel">
            <i></i>
            <p>咨询热线：<br/>4006-123-011<br/>售后电话：<br/>010-53305670</p>
        </li>
        <li class="wechat">
            <i></i>
            <p><img th:src="@{/images/erweima.png}" alt="扫描进入首页"/></p>
        </li>
        <li class="down"><i></i></li>
    </ul>
    <a class="switch"></a>
</div>

<script>
	$(function () {
		$.ajax({
			type: "POST",
			url: "/api-front/news/getCount",
			dataType: "text",
			success: function (msg) {
				var a = document.getElementById("myNews");
				if (msg === "0") {

					if (a != null) {
						document.getElementById("myNews").innerText = "我的消息";
					} else {
						document.getElementById("myNews2").innerText = "我的消息";
					}
				} else {

					if (a != null) {
						document.getElementById("myNews").innerText = "我的消息(" + msg + ")";
					} else {
						document.getElementById("myNews2").innerText = "我的消息(" + msg + ")";
					}
				}
			},
			error: function () {
				layer.alert("服务器正忙.....", {icon: 5});
			}
		});
	});
</script>

<script type="text/html" id="storyFrame">
    <div style="padding:50px;font-size: 15px">
        <div>故事标题：<i id="tt" style="color: red;font-size: 12px"></i><textarea name="titles" id="titles" cols="50"
                                                                              rows="1"
                                                                              style="resize: none;font-size: 20px;border-radius: 5px"
                                                                              onblur="rcverify(0)"></textarea></div>
        <br>
        <div>记录内容：<i id="cc" style="color: red;font-size: 12px"></i><textarea name="contents" id="contents" cols="50"
                                                                              rows="3"
                                                                              style="resize: none;font-size: 20px;border-radius: 5px"
                                                                              onblur="rcverify(1)"></textarea></div>
        <br>
        <div style="float: right">
            <button class="layui-btn layui-btn-xs layui-btn-radius" onclick="addStory()">发布故事</button>
        </div>
    </div>
</script>

</body>

<script type="text/javascript">
	verify1 = 0;
	verify2 = 0;
	var opAdd;
	layui.use(['carousel'], function () {
		var carousel = layui.carousel;
		var exposure_div = $("#exposure_div");
		//轮播
		var ins = carousel.render({
			elem: '#test10'
			, width: '800px'
			, height: '450px'
			, interval: 1000
		});
		var storyC = carousel.render({
			elem: '#storyCarousel'
			, width: '100%' //设置容器宽度
			, arrow: 'always' //始终显示箭头
			, anim: 'updown' //切换动画方式
			, height: '440px'
			, arrow: 'none'
			, indicator: 'none'
			, interval: 1000
		});
		$.ajax({
			url: '/exposure/list',
			type: 'get',
			success: function (data) {
				if (data.length > 0) {
					for (var i = 0; i < data.length; i++) {
						exposure_div.append(
							"<div style='width: 700px;height: 450px;padding: 50px'><b style='font-size: 22px;color: red'>曝光原因：<br><span style='word-wrap: break-word;overflow: hidden'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + data[i].ereason + "</span></b><br><br><b style='font-size: 22px'>曝光对象：" + data[i].uaccount + "</b><br><br><b style='font-size: 22px'>公示开始时间：" + data[i].estarttime + "</b><br><br><b style='font-size: 22px'>公示结束时间：" + data[i].eendtime + "</b></div>");
					}
				} else {
					exposure_div.append(
						"<div style='width: 700px;height: 450px;padding: 50px'><b>暂无【置顶】曝光，可以通过点击更多曝光按钮，查看有关曝光哦</b></div>")
				}
				ins.reload({elem: '#test10'});
			}, error: function (err) {
				console.log(err);
			}
		});

		var storydiv = $("#storydiv");
		$.ajax({
			//点击注册时数据提交的路径
			url: '/story/storyList',
			type: 'get',
			data: {},
			success: function (data) {
				if (data.length > 0) {
					if (data.length % 2 === 0) {
						for (var i = 0; i < data.length; i += 2) {
							storydiv.append("'<div style='padding: 20px; background-color: #F2F2F2;'><div class='layui-row layui-col-space15'><div class='layui-col-md6' style='height: 400px;width:48%'><div class='layui-card' style='height: 400px;width:100%'><div class='layui-card-header'><p>" + data[i].stitle + "---"+data[i].uaccount+"</p></div><div class='layui-card-body'><p>" + data[i].scontent + "-----"+data[i].stime+"</p></div></div></div><div class='layui-col-md6' style='height: 400px;width: 49%'><div class='layui-card' style='height: 400px;width: 100%'><div class='layui-card-header'><p>" + data[i + 1].stitle + "---"+data[i + 1].uaccount+"</p></div><div class='layui-card-body'><p>" + data[i + 1].scontent + "-----"+data[i+1].stime+"</p></div></div></div></div></div>");
						}
					} else {
						for (var i = 0; i < data.length; i++) {
							if (i < data.length - 1) {
								storydiv.append("'<div style='padding: 20px; background-color: #F2F2F2;'><div class='layui-row layui-col-space15'><div class='layui-col-md6' style='height: 400px;width:48%'><div class='layui-card' style='height: 400px;width:100%'><div class='layui-card-header'><p>" + data[i].stitle + "---"+data[i].uaccount+"</p></div><div class='layui-card-body'><p>" + data[i].scontent + "-----"+data[i].stime+"</p></div></div></div><div class='layui-col-md6' style='height: 400px;width: 49%'><div class='layui-card' style='height: 400px;width: 100%'><div class='layui-card-header'><p>" + data[i + 1].stitle + "---"+data[i + 1].uaccount+"</p></div><div class='layui-card-body'><p>" + data[i + 1].scontent + "-----"+data[i+1].stime+"</p></div></div></div></div></div>");
								i++;
							} else {
								storydiv.append("'<div style='padding: 20px; background-color: #F2F2F2;'><div class='layui-row layui-col-space15'><div class='layui-col-md6' style='height: 400px;width:48%'><div class='layui-card' style='height: 400px;width:100%'><div class='layui-card-header'><p>" + data[i].stitle + "---"+data[i].uaccount+"</p></div><div class='layui-card-body'><p>" + data[i].scontent + "-----"+data[i].stime+"</p></div></div></div></div></div>");
							}
						}
					}
				} else {
					storydiv.append("<div><b>暂时还没有雇主发布【置顶】的故事优质故事，赶紧来登录发布有关自己的故事吧</b></div>")
				}
				storyC.reload({elem: '#storyCarousel'})
			}, error: function (err) {
				console.log(err);
			}
		});
	});

	layui.use(['element'], function () {
		var element = layui.element;
		var rule = $("#rule");
		$.ajax({
			//点击注册时数据提交的路径
			url: '/rule/ruleList',
			type: 'get',
			success: function (data) {
				if (data.length > 0) {
					for (var i = 0; i < data.length; i++) {
						rule.append("<div class='layui-colla-item'><h2 class='layui-colla-title'>" + data[i].rtitle + "</h2><div class='layui-colla-content'><p style='font-size: 15px'>" + data[i].rcontent + "-----" + data[i].rtime + "</p></div></div>");
					}
				} else {
					rule.append("<div><b>暂无规则</b></div>")
				}
				element.init();
			}, error: function (err) {
				console.log(err);
			}
		});
	});

	layui.use(['form', 'layer'], function () {
		var layer = layui.layer, $ = layui.jquery;

		// 发布雇主故事
		$('#writeStory').on('click', function () {
			opAdd = layer.open({
				type: 1 //Page层类型
				, area: ['600px', '400px']
				, title: '发布雇主故事窗口'
				, shade: 0.3 //遮罩透明度
				, anim: 1 //0-6的动画形式，-1不开启
				, content: $("#storyFrame").html()
			});
		});

		// 信用分查询
		$('#searchCredit').on('click', function () {
			var creditA = $("#creditAccount").val();
			creditA = creditA.replace(/^\s+|\s+$/g, "");
			if (creditA.length === 0) {
				layer.msg("请输入账号后进行查询", {icon: 2})
			} else if (creditA.length > 15) {
				layer.msg("账号长度超出限制", {icon: 2});
			} else {
				$.ajax({
					type: "post",
					url: '/credit/searchCredit',
					data: {"uaccount": creditA},
					success: function (msg) {
						if (msg.uaccount === undefined) {
							layer.msg("账号不存在，请核实后重新查询", {icon: 2});
						} else {
							if (msg.uscore >= 85) {
								layer.alert("名称：" + msg.uname + "(ID：" + msg.uaccount + ")---当前信用分：" + msg.uscore + " 分，该用户信用较高，可以交易", {icon: 6});
							} else if (msg.uscore < 85 && msg.uscore >= 60) {
								layer.alert("名称：" + msg.uname + "(ID：" + msg.uaccount + ")---当前信用分：" + msg.uscore + " 分，该用户有部分的违约记录，请谨慎交易", {icon: 7});
							} else {
								layer.alert("名称：" + msg.uname + "(ID：" + msg.uaccount + ")---当前信用分：" + msg.uscore + " 分，该用户信用较低，请核实后慎重交易", {icon: 5});
							}
						}
					},
					error: function (msg) {
						layer.msg("连接服务器超时，请稍后重试", {icon: 2})
					}
				})
			}
		});

		$('.layui-elip').on('click', function () {

			var othis = $(this), //othis当前button对象
				method = othis.data('method');//data-method="dialog"中的值
			//注册
			if (method === "reg") {
				layer.open({
					type: 2,
					area: ['40%', '85%'],
					btn: ['注册', '取消'],
					offset: ['5%', '31%'],
					moveOut: true,
					btn1: function (index, layero) {
						//layer.getChildFrame("form", index)获取iframe的表单
						//serializeArray jquery方法，将表单对象序列化为数组
						var formData = serializeObject($, layer.getChildFrame("form", index).serializeArray());
						$.ajax({
							//点击注册时数据提交的路径
							url: '',
							type: 'post',
							data: formData,
							success: function (data) {
								layer.close(index);
							}, error: function (err) {
								console.log(err);
							}
						});
					},
					//弹出注册页面
					content: '/api-front/getPage?pageName=frontPage/user-reg' //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
					, success: function (layer, index) {
						console.log(layer, index);
					}
				});
			}
		});

	});

	function addStory() {
		rcverify(0);
		rcverify(1);
		var titles = $("#titles").val();
		titles = titles.replace(/^\s+|\s+$/g, "");
		var contents = $("#contents").val();
		contents = contents.replace(/^\s+|\s+$/g, "");
		if (verify1 === 1 || verify2 === 1) {
			layer.msg("发布输入长度不合法", {icon: 2});
		} else {
			$.ajax({
				type: "post",
				url: '/api-front/story/storyAdd',
				data: {"titles": titles, "contents": contents},
				success: function (msg) {
					if (msg === "success") {
						layer.msg("发布成功，等待管理员审核", {icon: 1});
						layer.close(opAdd);
					} else {
						layer.msg("网络繁忙，请稍后重新发布", {icon: 2});
					}
				},
				error: function (msg) {
					layer.msg("连接服务器超时，请稍后重试", {icon: 2})
				}
			})
		}
	}

	function rcverify(msg) {
		var titles = $("#titles").val();
		titles = titles.replace(/^\s+|\s+$/g, "");
		var contents = $("#contents").val();
		contents = contents.replace(/^\s+|\s+$/g, "");
		if (msg === 0) {
			if (titles.length >= 30 || titles.length === 0) {
				document.getElementById("tt").innerText = "故事标题长度规定1-30个字符，当前长度：" + titles.length;
				verify1 = 1;
			} else {
				document.getElementById("tt").innerText = "";
				verify1 = 0;
			}
		} else {
			if (contents.length >= 100 || contents.length === 0) {
				document.getElementById("cc").innerText = "故事内容规定1-100个字符，当前长度：" + contents.length;
				verify2 = 1;
			} else {
				document.getElementById("cc").innerText = "";
				verify2 = 0;
			}
		}

	}
</script>
<script>
	window.onload = function () {
		$.get("/latestInfo/frontGetLatestNews", function (res) {
			if (res !== null) {
				// 向latestNews中添加数据
				for (var i = 0; i < res.length; i++) {
					if (res[i].ltime !== null && res[i].ltime !== "") {
						$('#latestNews').append('<a href="' + res[i].lurl + '"><h3>【' + (i + 1) + '】' + res[i].ltitle + '【发布时间:' + res[i].ltime + '】</h3></a><br>');
					}
				}
			}
		});

		$.get("/industryDynamics/frontGetIndustryByRu", function (res) {
			if (res !== null) {
				for (var i = 0; i < res.length; i++) {
					if (res[i].tips1 !== null && res[i].tips1 !== "") {
						$('#industryTest').append('<a href="' + res[i].nurl + '"><h4 style="color: #CCCCCC">【' + (i + 1) + '】' + res[i].ntitle + '【发布时间:' + res[i].tips2 + '】</h4></a><br>');
					}
				}
			}
		});

		$.get("/industryDynamics/frontGetIndustryByShu", function (res) {

			if (res !== null) {
				for (var i = 0; i < res.length; i++) {
					if (res[i].tips1 !== null && res[i].tips1 !== "") {
						$('#industryShu').append('<a href="' + res[i].nurl + '"><h4 style="color: #CCCCCC">【' + (i + 1) + '】' + res[i].ntitle + '【发布时间:' + res[i].tips2 + '】</h4></a><br>');
					}
				}
			}
		});

		$.get("/industryDynamics/frontGetIndustryBySheng", function (res) {
			if (res !== null) {
				for (var i = 0; i < res.length; i++) {
					if (res[i].tips1 !== null && res[i].tips1 !== "") {
						$('#industrySheng').append('<a href="' + res[i].nurl + '"><h4 style="color: #CCCCCC">【' + (i + 1) + '】' + res[i].ntitle + '【发布时间:' + res[i].tips2 + '】</h4></a><br>');
					}
				}
			}
		});

		$.get("/industryDynamics/frontGetIndustryByZhi", function (res) {
			if (res !== null) {
				for (var i = 0; i < res.length; i++) {
					if (res[i].tips1 !== null && res[i].tips1 !== "") {
						$('#industryZhi').append('<a href="' + res[i].nurl + '"><h4 style="color: #CCCCCC">【' + (i + 1) + '】' + res[i].ntitle + '【发布时间:' + res[i].tips2 + '】</h4></a><br>');
					}
				}
			}
		});

		$.ajax({
			url: '/friend/friendListFront',
			type: 'get',
			async: false,
			success: function (data) {
				var arr = data;
				$('#friendShipLink').append('<ul class="items list-inline" id="link"></ul>');
				for (var i = 0; i < arr.length; i++) {

					$('#link').append('<li style="background: url(' + arr[i].fimage + ') no-repeat 0.6rem 0.6rem;background-size:180px,180px;vertical-align:middle;"   onclick="clickLi(this)" id="' + arr[i].furl + '"></li>');

					//alert(arr[i].fimage);

					// $('#link').append('<li class="' + arr[i].fimage + '" onclick="clickLi(this)" id="' + arr[i].furl + '"></li>');
					if (i >= 15) {
						break;
					}
				}
			}, error: function (err) {
				console.log(err);
			}
		});

		$.get("/successCaseFront/successOrders", function (res) {
			if (res !== null) {
				for (var i = 0; i < 2; i++) {
					if (res[i].oid !== null && res[i].oid !== "") {
						$('#succCase').append(
							'<div class="swiper-slide">' +
							'<a href="/cases/51.html" target="_blank">' +
							'<img src="/images/0111546659.jpg" alt="中交一局海外分公司网站建设项目"/>' +
							'<p>网站设计<br/><strong>中交一局海外分公司网站建设项目</strong><br/>蓝色 , 欧美风格 , 国有企业</p></a>' +
							'</div>');
						if (i > 2) {
							break;
						}


					}
				}
			}
		});
	}

	function clickLi(node) {
		alert(node.id);
		location.href = node.id;
	}

	$.ajax({
		url: '/friend/getCounltantUsder',
		type: 'get',
		async: false,
		success: function (data) {
			var arr = data;
			// alert(arr);
			for (var i = 0; i < arr.length; i++) {

				if (i <= 4) {
					$('#tr1').append(' <td> <div class="single-member effect-7">\n' +
						'                <div class="member-info">\n' +
						'                    <h3>' + arr[i].uname + '</h3>\n' +
						'                    <h5>' + arr[i].tips1 + '</h5>\n' +
						'                </div>\n' +
						'                <div class="member-image">\n' +
						'                    <img src="/bootstrapguo/images/member_270x210.jpg" alt="Member" height="15%" width="30%">\n' +
						'                </div>\n' +
						'                <div class="more-info">\n' +
						'                    <p>账号：' + arr[i].uaccount + '<br>信用分：' + arr[i].uscore + '<br> consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit </p>\n' +
						'                    <div class="social-touch icon-colored">\n' +
						'                        <a class="fb-touch" href="#"></a>\n' +
						'                        <a class="tweet-touch" href="#"></a>\n' +
						'                        <a class="linkedin-touch" href="#"></a>\n' +
						'                    </div>\n' +
						'                </div>\n' +
						'            </div></td>');

				} else {
					if (i >= 10) {
						break;
					}
					$('#tr2').append(' <td> <div class="single-member effect-7">\n' +
						'                <div class="member-info">\n' +
						'                    <h3>' + arr[i].uname + '</h3>\n' +
						'                    <h5>' + arr[i].tips1 + '</h5>\n' +
						'                </div>\n' +
						'                <div class="member-image">\n' +
						'                    <img src="/bootstrapguo/images/member_270x210.jpg" alt="Member" height="15%" width="30%">\n' +
						'                </div>\n' +
						'                <div class="more-info">\n' +
						'                    <p>账号：' + arr[i].uaccount + '<br>信用分：' + arr[i].uscore + '<br> consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit </p>\n' +
						'                    <div class="social-touch icon-colored">\n' +
						'                        <a class="fb-touch" href="#"></a>\n' +
						'                        <a class="tweet-touch" href="#"></a>\n' +
						'                        <a class="linkedin-touch" href="#"></a>\n' +
						'                    </div>\n' +
						'                </div>\n' +
						'            </div></td>');
				}


			}
		}, error: function (err) {
			console.log(err);
		}
	});

</script>
</html>